package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouClckMapper;
import com.ruoyi.system.domain.SysYongyouClck;
import com.ruoyi.system.service.ISysYongyouClckService;

/**
 * 材料出库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouClckServiceImpl implements ISysYongyouClckService 
{
    @Autowired
    private SysYongyouClckMapper sysYongyouClckMapper;

    /**
     * 查询材料出库
     * 
     * @param vouchdate 材料出库主键
     * @return 材料出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouClck selectSysYongyouClckByVouchdate(String vouchdate)
    {
        return sysYongyouClckMapper.selectSysYongyouClckByVouchdate(vouchdate);
    }

    /**
     * 查询材料出库列表
     * 
     * @param sysYongyouClck 材料出库
     * @return 材料出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouClck> selectSysYongyouClckList(SysYongyouClck sysYongyouClck)
    {
        return sysYongyouClckMapper.selectSysYongyouClckList(sysYongyouClck);
    }

    /**
     * 新增材料出库
     * 
     * @param sysYongyouClck 材料出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouClck(SysYongyouClck sysYongyouClck)
    {
        return sysYongyouClckMapper.insertSysYongyouClck(sysYongyouClck);
    }

    /**
     * 修改材料出库
     * 
     * @param sysYongyouClck 材料出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouClck(SysYongyouClck sysYongyouClck)
    {
        return sysYongyouClckMapper.updateSysYongyouClck(sysYongyouClck);
    }

    /**
     * 批量删除材料出库
     * 
     * @param vouchdates 需要删除的材料出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouClckByVouchdates(String[] vouchdates)
    {
        return sysYongyouClckMapper.deleteSysYongyouClckByVouchdates(vouchdates);
    }

    /**
     * 删除材料出库信息
     * 
     * @param vouchdate 材料出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouClckByVouchdate(String vouchdate)
    {
        return sysYongyouClckMapper.deleteSysYongyouClckByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteByDateRange(String startDate)
    {
        return sysYongyouClckMapper.deleteByDateRange(startDate);
    }
}
